package com.eascs.workflow.processAuthorization.controller;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.eascs.app.dao.PageResult;
import com.eascs.site.page.PaginationInfo;
import com.eascs.site.view.ViewContext;
import com.eascs.site.view.button.AjaxButton;
import com.eascs.site.view.button.Button;
import com.eascs.site.view.button.OpenButton;
import com.eascs.tag.MenuTag;
import com.eascs.workflow.common.controller.BaseMasterViewController;
import com.eascs.workflow.processAuthorization.service.IProcessAuthorizationService;
import com.eascs.workflow.processAuthorization.vo.ProcessAuthorizationVo;

@Controller
@RequestMapping("/processAuth")
public class ProcessAuthorizationController extends BaseMasterViewController {
	
	@Inject
	private IProcessAuthorizationService processAuthorizationService;
	
	
	@Override
	public void preHandle() {
		super.preHandle();
		ViewContext.put(MenuTag.CURRENT_MENU_CODE, "processAuth");
	}

	
	@RequestMapping("/list")
	public String listUser(ProcessAuthorizationVo vo) {
		vo.setPageSize(10);
		PageResult<Object[]> pageResult = processAuthorizationService.findProcessAuthorizationInfo(vo);
		String[] titles = { "流程大类", "流程类型", "转出人", "转入人", "授权开始时间", "授权结束时间","状态"};
		AjaxButton rbutton = new AjaxButton("操作", "/rProcessAuth/editAuth?id=");
		Button[] detailButton = new Button[] { rbutton};
		PaginationInfo paginationInfo = new PaginationInfo(pageResult, titles, "/processAuth/list?showPage=");
		paginationInfo.setBuildPagingNavigation(true);
		paginationInfo.setFirstRenderColumnIndex(1);
		paginationInfo.setMoreButtons(detailButton);
		ViewContext.put("paginationInfo", paginationInfo);
		return "/processAuth/list";
	}
  
	
}
